import { createApp } from 'vue'
import pinia from '@/stores'
// 导入elementui插件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './styles/normal.css'
import App from './App.vue'
import router from './router'
import store from './stores'
import axios from './utils/request'
import * as echarts from 'echarts'
import './styles/style.css'
// 导入所有图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// px2rem 自适应
import 'lib-flexible'
// 创建vue根示例
const app = createApp(App)
// 将二次封装的axios方法挂载在vue3上面共全局使用
app.config.globalProperties.$echarts = echarts
app.config.globalProperties.$get = axios.get
app.config.globalProperties.$post = axios.post
app.config.globalProperties.$put = axios.put
app.config.globalProperties.$delete = axios.delete
app.config.globalProperties.$download = axios.download
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
// 注册pinia全局状态管理工具
app.use(pinia)
// 注册路由
app.use(router)
// 注册elementui插件
app.use(ElementPlus)
// 挂载渲染App根组件
app.mount('#app')
